import request from '@/Utils/request'

// 获取区域列表
export const getAreaList = params => request.get('/api/vm-service/region/search', { params })

// 点位管理列表
export const getNodeList = params => request.get('/api/vm-service/node/search', { params })

// 新增区域
export const addArea = data => request.post('/api/vm-service/region', data)

// 删除区域
export const delArea = id => request.delete(`/api/vm-service/region/${id}`)

// 修改
export const editArea = data => request.put(`/api/vm-service/region/${data.id}`, {
  regionName: data.regionName,
  remark: data.remark
})

// 点位搜索
export const nodeSearch = params => request.get('/api/vm-service/node/search', { params })

// 删除点位
export const delPlace = id => request.delete(`/api/vm-service/node/${id}`)

// 点位详情
export const getPlaceDetail = id => request.get(`/api/vm-service/node/vmList/${id}`)

// 获取商圈列表
export const getBusinessList = () => request.get('/api/vm-service/businessType')

// 获取合作商列表
export const getPartnerList = params => request.get('/api/user-service/partner/search', { params })

// 新增点位
export const addPlace = data => request.post('/api/vm-service/node', data)

// 修改点位
export const placePut = data => request.put(`/api/vm-service/node/${data.id}`, data)

// 合作商列表
export const getWithList = params => request.get('/api/user-service/partner/search', { params })

// 合作商搜索
export const withSearch = params => request.get('/api/user-service/partner/search', { params })

// 新增合作商
export const addWith = data => request.post('/api/user-service/partner', data)

// 重置密码
export const resetPassword = id => request.put(`/api/user-service/partner/resetPwd/${id}`)

// 删除合作商
export const delWith = id => request.delete(`/api/user-service/partner/${id}`)

// 修改合作商
export const editWith = data => request.put(`/api/user-service/partner/${data.id}`, data)
